#ifndef QTBOARDPREVIEWITEM_H_
#define QTBOARDPREVIEWITEM_H_

#include "BoardPreview.h"

#include <QGraphicsItem>
#include <QObject>
#include <QPainter>
#include <QPixmap>
#include <QStyle>
#include <QStyleOptionGraphicsItem>

class QGraphicsSceneMouseEvent;

class QtBoardPreviewItem : public QObject, public QGraphicsItem, public BoardPreview
{
	Q_OBJECT

public:
	QtBoardPreviewItem(QString label);
	virtual ~QtBoardPreviewItem();

	QRectF boundingRect() const;
	QPainterPath shape() const;
	void paint(
			QPainter *painter,
			const QStyleOptionGraphicsItem *option,
			QWidget *widget);
			
	void drawSelected();
	void drawUnselected();

protected:
	void mousePressEvent(QGraphicsSceneMouseEvent *event);

signals:
	void itemChecked(QGraphicsItem * item);
	
private:
	QPixmap * image;
	QPixmap * pixmap;
};

#endif /*QTBOARDPREVIEWITEM_H_*/
